home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Libris Britannia 4
/
science library(b).zip
/
science library(b)
/
PROGRAMM
/
PASCAL
/
0921.ZIP
/
FORM.ARC
/
_FORM.DOC
next >
Wrap
Text File
|
1987-11-16
|
2KB
|
39 lines
PROGRAM Form_Test;
{ This test program uses the Turbo Pascal Unit "_FORM" which partially
replaces the FORM function in Turbo Pascall 3.0 with BCD. The calling
procedure is shown below in examples. Please feel free to improve and
upload improvements. - Paul Mayer [70040,645] }
USES CRT, _FORM;
VAR
I : Word;
BEGIN
ClrScr;
WriteLn('A few examples of using the "Form(''<mask>'',<variable or number>)" function.');
WriteLn('Written by Paul Mayer for compatibility with Turbo Pascal 3.0 with BCD as the');
WriteLn('"Form" function is not included in the new Turbo Pascal version 4.0. ');
WriteLn;
WriteLn('Numbers and comma delimiter using WriteLn(Form(''###,###.##'', 67235.98))');
WriteLn(Form('###,###.##', 67235.98));
WriteLn;
WriteLn('Numbers too big for pattern using WriteLn(Form(''###,###.##'', 6723543.98))');
WriteLn(Form('###,###.##', 6723543.98));
WriteLn;
WriteLn('Small Numbers using WriteLn(Form(''###.##'', 3.98))');
WriteLn(Form('###.##', 3.98));
WriteLn;
WriteLn('Format past the decimal point using WriteLn(Form(''#.###'', 1.985))');
WriteLn(Form('#.###', 1.985));
WriteLn;
WriteLn('Numbers without decimal using WriteLn(Form(''####'', 1.985)) (Watch the roundoff)');
WriteLn(Form('####', 1.985));
WriteLn;
WriteLn('Numbers as a dollar format using WriteLn(Form(''$#,###.##'', 2876.89))');
WriteLn(Form('$#,###.##', 2876.89));
WriteLn;
WriteLn('Text & numbers using WriteLn(Form(''Payroll Total: $#,###,###.##'', 4567235.98))');
WriteLn(Form('Payroll Total: $#,###,###.##', 4567235.98));
ReadLn;
END.